Skip to content

Add an extension walkthrough #1572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

plemarquand
Copy link
Contributor

@plemarquand plemarquand commented May 21, 2025

Adds a walkthrough to the package.json that guides users through:

  • Installing Swift
  • Creating a New Project
  • Extension Commands
  • Running Tests
  • Selecting a Toolchain

#1560

Adds a walkthrough to the package.json that guides users through:

- Installing Swift
- Creating a New Project
- Extension Commands
- Running Tests
- Selecting a Toolchain
{
"id": "installing-mac",
"title": "Installing Swift",
"description": "💻 Swift is cross-platform! If you already have Xcode installed, you're ready to go. Otherwise, see the instructions to [install on macOS](https://www.swift.org/install).\n🧑‍🤝‍🧑 Swift is [open source](https://github.com/swiftlang) and community driven!\n💬 Questions? Visit the [Swift forums](https://forums.swift.org/) for help.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideas for the future:

  • Can possibly detect automatically if swift is already installed and skip this point if it is?
  • I think this is where the swiftly "Download Swift" command can go once the project is implemented

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya or link to install page on swift.org

}
]
}
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideas for some other steps (some of these could be in their own section)

  • Project Panel
  • Useful settings (inlay hints come to mind so that the user is aware of the feature, possibly other useful settings as well)
  • Debugging
  • Project Panel
  • Documentation generation with DocC
  • Tips like hovering over the {} icon to see which swift version you're currently using

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe flag the environment and args settings and that they tie into all tasks?

@@ -0,0 +1,10 @@
The Swift extension automatically detects your installed Swift toolchain. However, it also provides a command called `Swift: Select Toolchain...` which can be used to select between toolchains if you have multiple installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we can link to other pieces of documentation but perhaps we could link to some documentation on how the extension detects which toolchain it will use? I think the logic is a little tricky since it depends on things like environment variables, is swiftly installed, is Xcode installed etc.

@@ -0,0 +1,12 @@
There are several project templates to choose from:
- `Library`: A package with a library. Use this to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this sentence is unfinished.

@@ -0,0 +1,12 @@
There are several project templates to choose from:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be cool if there was some way we could just generate this from the code. I feel like we'll forget to update this page if we change the template options in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but these descriptions aren't going to 1:1 match the ones from SwiftPM's help documentation so we'd need to craft a description for each one by hand anyway.

Copy link
Contributor

@award999 award999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing start, here are some thoughts


You may be prompted to select where to configure this new path. Your options are to:

- Save it in User Settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to what is done for command names, we should show button text as Save it in User Settings and Save in Workspace Setting

- Save it in User Settings
- Save it in Workspace Settings

Keep in mind that Workspace Settings take precedence over User Settings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for the User Settings tab name too?

{
"id": "installing-mac",
"title": "Installing Swift",
"description": "💻 Swift is cross-platform! If you already have Xcode installed, you're ready to go. Otherwise, see the instructions to [install on macOS](https://www.swift.org/install).\n🧑‍🤝‍🧑 Swift is [open source](https://github.com/swiftlang) and community driven!\n💬 Questions? Visit the [Swift forums](https://forums.swift.org/) for help.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The open source and Swift forums mentions and links I think we should take out of the install, maybe leave it as a final Get Help step. Seems a little noisy here

{
"id": "installing-mac",
"title": "Installing Swift",
"description": "💻 Swift is cross-platform! If you already have Xcode installed, you're ready to go. Otherwise, see the instructions to [install on macOS](https://www.swift.org/install).\n🧑‍🤝‍🧑 Swift is [open source](https://github.com/swiftlang) and community driven!\n💬 Questions? Visit the [Swift forums](https://forums.swift.org/) for help.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya or link to install page on swift.org

{
"id": "installing-mac",
"title": "Installing Swift",
"description": "💻 Swift is cross-platform! If you already have Xcode installed, you're ready to go. Otherwise, see the instructions to [install on macOS](https://www.swift.org/install).\n🧑‍🤝‍🧑 Swift is [open source](https://github.com/swiftlang) and community driven!\n💬 Questions? Visit the [Swift forums](https://forums.swift.org/) for help.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically command line tools works too for people who don't want Xcode

{
"id": "swift-commands",
"title": "Swift Commands",
"description": "🎨 Explore the commands available in the command palette prefixed with \"> Swift:\". You can use the command palette to run any of the commands provided by the Swift extension.\n[Open Command Palette](command:workbench.action.showCommands)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create our own Show Swift Commands... command that wraps await vscode.commands.executeCommand("workbench.action.quickOpen", "> Swift:");

{
"id": "testing",
"title": "Running Tests",
"description": "✅ Tests are automatically discovered in your project and added to the [Testing View](https://code.visualstudio.com/docs/debugtest/testing#_automatic-test-discovery-in-testing-view).\n🧪 Both [XCTest](https://developer.apple.com/documentation/xctest) and [Swift Testing](https://developer.apple.com/xcode/swift-testing/) tests are supported.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe command to run all tests or use one of the add test target refactorings?

}
]
}
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe flag the environment and args settings and that they tie into all tasks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants